package com.teaching.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.teaching.entity.Attach;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * 附件表
 *
 * @author xubb
 * @date 2021-03-22 15:27:55
 */
public interface AttachService extends IService<Attach> {

    /**
     * 通用保存文件
     * @param file
     * @param groupGUid
     * @param groupType
     * @throws IOException
     */
    String save(MultipartFile file, String groupGUid, String groupType) throws IOException;


    /**
     * 导出、下载文件
     * @param file
     * @return
     */
    ResponseEntity<FileSystemResource> export(File file) throws UnsupportedEncodingException;
}
